feat(v10/solid,solidstart): Support @solidjs/router v1 - #23163
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 54e5079. Configure here.
| }, | ||
| "peerDependencies": { | ||
| "@solidjs/router": "^0.13.4 || ^0.14.0 || ^0.15.0", | ||
| "@solidjs/router": ">=0.13.4 <2.0.0-0", |
There was a problem hiding this comment.
Bug: The peer dependency for @solidjs/router was updated to include v1.x, but the code using useBeforeLeave is not compatible with the breaking API changes, likely causing runtime errors.
Severity: HIGH
Suggested Fix
Update the implementation in packages/solid/src/solidrouter.ts to be compatible with the breaking changes in @solidjs/router v1.0.0, specifically how the useBeforeLeave event argument is handled. Alternatively, revert the peer dependency range in package.json to exclude v1.x versions.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: packages/solid/package.json#L62
Potential issue: The peer dependency for `@solidjs/router` was updated to allow v1.x,
but the implementation in `packages/solid/src/solidrouter.ts` was not updated to handle
breaking changes. The code uses `useBeforeLeave` and expects the `to` property from the
event argument to be a string-like value. However, v1.0.0 of the router changes `to` to
be a location object. Calling `to.toString()` on this object will likely result in a
runtime error or incorrect behavior during navigation, as the code is not prepared to
handle the new object structure.
Also affects:
packages/solidstart/package.json:60~60
Did we get this right? 👍 / 👎 to inform future reviews.
size-limit report 📦
|
) ## What Bump `@solidjs/router` from `^0.15.0` to `^1.0.0` in the SolidStart 1 e2e test apps. - `solidstart`, `solidstart-spa`, `solidstart-top-level-import`, `solidstart-dynamic-import` ## Why #23162 widened the `@solidjs/router` peer range to `>=0.13.4 <2.0.0-0`, but only the `solidstart-2` app ran against v1, so the SolidStart 1 + router v1 combination the range now advertises had no coverage. The equivalent bump on v10 (#23163) passes all four suites locally. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>

Backport of: #23162